import { createRouter, createWebHistory } from 'vue-router'
import Main from '../pages/Main.vue'
import Home from '../pages/Home.vue'
import Artist from '../pages/Artist.vue'
import Album from '../pages/Album.vue'
import User from '../pages/User.vue'
import myAlbum from '../pages/my-album.vue'
import myArtist from '../pages/my-artist.vue'
import myMv from '../pages/my-mv.vue'

const routes = [
  {
    path:'/',
    component:Main,
    redirect: '/home',
    children:[
      {
        path: '/home',
        name: 'home',
        component: Home
      },
      {
        path:'/artist',
        name:'artist',
        component: Artist
      },
      {
        path:'/album',
        name:'album',
        component: Album
      },
      {
        path:'/user',
        name:'user',
        component:User,
        redirect:'/user/my-album',
        children:[
          {
            path:'/user/my-album',
            name:'my-album',
            component:myAlbum
          },
          {
            path:'/user/my-artist',
            name:'my-artist',
            component:myArtist
          },
          {
            path:'/user/my-mv',
            name:'my-mv',
            component:myMv
          }
        ]
      }
    ]
  }
  
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router
